<%@page import="cn.school.mybaits.entity.Grade"%>
<%@page import="java.util.List"%>
<%@page import="cn.school.mybaits.Dao.GradeDao"%>
<%@page import="cn.school.mybaits.xml.MyBatisUtil"%>
<%@page import="org.apache.ibatis.session.SqlSession"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<div>
		<form action="AddSubject.jsp" method="post">
			<p>
				<input type="text" name="subjectname" placeholder="科目名称">
			</p>
			<p>
				<input type="text" name="classhour" placeholder="科目时长">
			</p>
			<p>
				<%
				out.print("年级id");
				SqlSession s=MyBatisUtil.get();
				GradeDao gradeDao=s.getMapper(GradeDao.class);
				List<Grade> list=gradeDao.search();
				out.print("<select name='gradeid'>");
				for(Grade g:list){
					out.print("<option value="+g.getId()+">"+g.getId()+"</option>");
				}
					out.print("</select>");	
				%>
			</p>
			<p>
				<input type="submit" value="提交">
			</p>
		</form>
	</div>
</body>
</html>